﻿@model KingRoad.EPM.Web.Areas.Device.Models.MeterModel
@{
    ViewBag.Title = "仪表信息列表";
}
@using KingRoad.EPM.Common.Helper;

     <form action="@Url.Action("IndexQuerySplitPage", "Meter")" method="post" id="pagerForm123" onsubmit="return dwzSearch(this, 'dialog');">
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />

    <ul class="searchBar">
        <li><span>仪表编号：</span>
            <input type="text" name="iput_code" value="@(ViewBag.iput_code)" />
        </li>
        <li><span>仪表型号：</span>
            <input type="text" name="iput_type" value="@(ViewBag.iput_type)" />
        </li>
        <li>
            <button type="submit" class="btn btn-success btn-xs">
                搜索</button>
        </li>
    </ul>
</form>
 @*<div class="panelBar" style="border-top: none;">
        <ul class="toolBar">
           
            <li>
           
                 @Html.PermissionButton("Device.Meter.Binding", "Device_Meter_MeterBinding",
                 Url.Action("MeterBinding", "Meter", new { id = "{ids}",roadId = @ViewBag.roadId }), 
                 "绑定",
                 new Dictionary<string, object> {
                 { "class", "delete" },{"title","确定要删除这条记录吗?"},{"target","ajaxTodo"},{"callback","function(){$('#pagerForm', navTab.getCurrentPanel()).submit();}"}
                 })
            </li>
           
        </ul>
    </div>*@


<table class="table" width="100%" layouth="148" nowraptd="false" aria-relevant="ybxx_indexquery">
    <thead>
        <tr>
            <th width="22" style="display:none">
                <input type="checkbox" group="ids" class="checkboxCtrl" />
            </th>
            <th width="10" align="center">
                序号
            </th>
            <th width="30" align="center">
                仪表编号
            </th>
            <th width="30" align="center">
                仪表型号
            </th>
           
            <th width="50" align="center">
                授权日期
            </th>
            <th width="30" align="center">
                状态
            </th>
             <th width="20">
                    选择
                </th>
        </tr>
    </thead>
    <tbody>
        @{ int num = (ViewBag.pageNum - 1) * ViewBag.numPerPage;}
        @foreach (var item in Model.list)
        {
            num += 1;
            <tr target="ids" rel="@item.Id">
                <td style="display:none">
                    <input name="ids" value="@item.Id" type="checkbox">
                </td>
                <td width="10" align="center">@num
                </td>
                <td width="30" align="center">
                    <a style="color:#000" href="@Url.Action("MeterEdit", "Meter", new { id = item.Id,target="view" })" rel="tzgl_zyry_detail" mask="true" target="dialog" width="690" height="560">@item.Code</a>
                </td>
                <td width="30" align="center">@item.Model
                </td>
             
               <td width="50" align="center">@Convert.ToDateTime(item.BandDate).ToString("yyyy-MM-dd")
                </td>
                  <td width="30" align="center">@item.UseState
                </td>
                <td align="center">
                     @Html.PermissionButton("Device.Meter.Binding", "Device_Meter_MeterBinding",
                 Url.Action("MeterBinding", "Meter", new { id = @item.Id, roadId = @ViewBag.roadId }), 
                 "绑定",
                 new Dictionary<string, object> {
                 { "class", "btnSelect" },{"title","确定要绑定这条记录吗?"},{"target","ajaxTodo"},{"callback","function(){$('#pagerForm', navTab.getCurrentPanel()).submit(); $.pdialog.closeCurrent();}"}
                 })
                
                  
                </td>
            </tr>
               
        }
    </tbody>
</table>
<div class="panelBar" style="border-bottom: none;">
    <div class="pages"  style="float: right">
        <span>显示</span>
        <select class="comsplitpage" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value},'cdxx_list')">
            <option value="10" @(ViewBag.numPerPage == 10 ? "selected='selected'" : "")>10</option>
                <option value="20" @(ViewBag.numPerPage == 20 ? "selected='selected'" : "")>20</option>
                <option value="50" @(ViewBag.numPerPage == 50 ? "selected='selected'" : "")>50</option>
        </select>
        <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
    </div>
    <div class="pagination" style="margin:0px;float:left; margin-left:35%" rel="cdxx_list" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="10" currentpage="@(ViewBag.pageNum)">
    </div>
</div>
<script type="text/javascript">
    function MyBringBack(obj) {
        $.each(obj, function (key, val) {
            $("#" + key).val(val);
        });
        $.bringBack();
    }
</script>